package com.yanqu.road.entity.enums;

/**
 * @author duli
 * @version 1.0
 * @date 2020/11/17 14:37
 * @Description 特权卡类型
 */
public enum CardType implements ConvertibleEnum<Integer> {

    MonthCard(0,"月卡"),

    YearCard(1,"年卡"),
    ;

    private int intValue;

    private String name;

    CardType(int value, String name) {
        intValue = value;
        this.name = name;
    }

    @Override
    public Integer getIntValue() {
        return intValue;
    }

    @Override
    public String getName() {
        return name;
    }

    public static CardType forValue(int value) {
        for (CardType type : CardType.values()) {
            if (type.intValue == value) {
                return type;
            }
        }
        return null;
    }
}
